<?php

namespace app\model;

use app\BaseModel;
use think\model\relation\BelongsTo;

/**
 * 量表测评记录
 */
class RatingScaleLogModel extends BaseModel
{
    protected $name = 'rating_scale_log';

    /**
     * 量表
     * @return BelongsTo
     */
    public function RatingScale(): BelongsTo
    {
        return $this->belongsTo('RatingScaleModel','rating_scale_id')->bind([
            'rating_scale_name' => 'name',
            'rating_scale_type_name',
        ]);
    }

    /**
     * 用户
     * @return BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo('UserModel','uid')->bind([
            'user_name' => 'name',
            'department_id',
            'unit_name'
        ]);
    }
}